import type { MockMethod } from 'vite-plugin-mock';

const tokens = {
    admin: {
        token: 'admin-token'
    },
    editor: {
        token: 'editor-token'
    }
}

export default [
    {
        url: '/dev-api/wisdom-ac/auth/login',
        method: 'post',
        response: (config) => {
            const { username, password } = config.body
            console.log(username)
            console.log(password)
            if(username === 'admin' && password === '123456') {
                return {"code":0,"msg":"操作成功","ds":{"token":"eyJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2Nzk1NjUyMTIsInVzZXJJZCI6ImFkbWluIiwiaWF0IjoxNjc5NTU4MDEyfQ.lVm5PUAgw5y1vCfCvBsbaR6cQiFFhZt5NoQmQIO1-5k","user":{"id":"admin","creator":"WisdomUserId","createTime":"2023-03-23T07:21:19.000+00:00","lastModifier":"WisdomUserId","lastModifyTime":"2023-03-23T07:21:19.000+00:00","timeStamp":1679556079290,"username":"admin","password":null,"staffId":null,"enabled":true,"userRoles":[]}}};
            }else {
                return {
                    code: 101003,
                    msg: '用户或密码错误.'+username+' / '+ password
                }
            }

        },
    },
    {
        url: '/dev-api/wisdom-ac/auth/logout',
        method: 'post',
        response: (config) => {
            return {
                code: 0,
                msg: ''
            };
        },
    },
    {
        url: '/dev-api/wisdom-ac/auth/captcha',
        method: 'get',
        response: (config) => {
            return {"code":0,"msg":"操作成功","ds":{"uuid":"382e7d7cdb3841f2b869336097d14d8b","captchaImage":"/9j/4AAQSkZJRgABAgAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAAoAG4DASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDK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